var express = require('express');
var app = express();
var router = require('./app/router');


// 使用模版
app.set('views', './app/views');
app.set('view engine', 'ejs');

//使用静态文件
app.use(express.static('./public', {
    maxAge: '0', //no cache
    etag: true
}));


//路由
/*app.get('/',function(req,res){
	res.render('index');
});*/

/*app.get('/',function(req,res){
	res.send('hello world!');
});*/

router(app);



var server = app.listen(3000, function() {
    var host = server.address().address;
    var port = server.address().port;

    console.log('sample app listening at http://%s:%s', host, port);
});